/** \file    shell.h
  * \brief   Facilities to register file associations in Windows shell.
  * \date    2003
  * \author  Fedor Chelnokov
  * \version $Header: /home/cscom1r4/cvsroot/cs/include/mswin/shell.h,v 1.1 2004/01/23 21:29:34 cscom1r4 Exp $
  */

#ifndef _shell_h_
#define _shell_h_

#include <string>

namespace mswin {

//see "Extending Shortcut Menus" and "File Associations: File Types" topics 
//in MSDN for more details

///associates file extension (with or without leading dot) with
///given ProgId as primary open tool, moving previous primary association
///into OpenWith category
void AssociatePrimaryProgId(std::string Ext, const std::string & ProgId,
							const std::string & MIMEType = std::string());

///returns empty string if nothing is associated
std::string GetPrimaryProgId(std::string Ext);

///associates file extension (with or without leading dot) with
///given ProgId as secondary open tool (OpenWith category) if another
///primary association already exists for the extension
void AssociateSecondaryProgId(std::string Ext, const std::string & ProgId);

///removes ProgId from either primary or secondary association with the extension
void CancelProgIdAssociation(std::string Ext, const std::string & ProgId);

///registers an icon for ProgId
void SetProgIdDescriptionAndIcon(const std::string & ProgId, 
	const std::string & Desc, const std::string & Icon);

///registers an action verb for ProgId, typically it is "open" verb, which is default action
void SetProgIdAction(const std::string & ProgId, const std::string & Command,
	const std::string & Verb = "open", const std::string & Desc = std::string(),
	bool def = true);

} //namespace mswin

#endif //_shell_h_
